<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
</head>

<body>
    <div id="app">
        <ul>
            <!-- <li v-if="show">苹果 </li>
            <li v-else-if="two">香蕉 </li>
            <li v-else>雪梨 </li> -->
            <li v-for="(item,index) in arr ">{{index}}-{{item.name}} </li>

        </ul>
        <p v-for="(item,index) in list"></p>
        <!-- <p v-show="show">这是一个段落</p> -->
        <button @click="show=!show">切换</button>
        <template v-for="(item,index) in list">
            <h2>姓名:{{item.name}}</h2>
            年龄:{{item.age}}
        </template>

    </div>
    <script>
        new Vue({
            el: "#app",
            data() {
                return {
                    show: false,
                    two: false,
                    arr:['路飞','索隆','娜美'],
                    list:{
                        name:"路飞",
                        age:11
                    },

                }
            }
        })
    </script>
</body>

</html>